package jmine.tec.script.persistent.driver;

import java.util.regex.Matcher;

/**
 * Parser de Inject into: y bean: y
 * 
 * @author lundberg
 * @param <T> tipo de scriptbean aceito
 */
public class InjectIntoBeanParser<T extends ScriptBean> extends AbstractScriptParameterParser<T> {

    /**
     * Construtor
     */
    public InjectIntoBeanParser() {
        super("(?i)\\s*Inject\\s+into:\\s*(\\w+)\\s+bean:\\s*(\\w+)\\s*");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void doParse(T bean, Matcher matcher) {
        bean.getDependencies().put(matcher.group(1), matcher.group(2));
    }
}
